package jeons.admin.buildproduct.biz.impl;

import java.util.List;




import jeons.admin.buildproduct.biz.BuildQnaAdminBiz;
import jeons.admin.buildproduct.dto.BuildQnADTO;
import jeons.admin.buildproduct.dto.BuildQnaReplyDTO;
import jeons.admin.buildproduct.dto.BuildSearchDTO;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class BuildQnaAdminBizImpl extends SqlMapClientDaoSupport implements BuildQnaAdminBiz{
	@Autowired SqlMapClientTemplate sqlMapClientTemplate;
	
	
	@Override
	public void insert(BuildQnaReplyDTO buildQnaReplyDTO) {
		sqlMapClientTemplate.insert("AdminBuildQna.insert", buildQnaReplyDTO);
		
	}


	@Override
	public int getCount(BuildSearchDTO searchDTO) {
		return (int) sqlMapClientTemplate.queryForObject("AdminBuildQna.getCount", searchDTO);
	}


	@SuppressWarnings("unchecked")
	@Override
	public List<BuildQnADTO> getist(BuildSearchDTO searchDTO) {
		return sqlMapClientTemplate.queryForList("AdminBuildQna.getList",searchDTO);
	}


	@Override
	public BuildQnADTO getData(int qnano) {
		return (BuildQnADTO) sqlMapClientTemplate.queryForObject("AdminBuildQna.getData",qnano);
	}


	@Override
	public void statusUpadate(int qnano) {
		sqlMapClientTemplate.update("AdminBuildQna.statusUpdate",qnano);
		
	}


	@Override
	public BuildQnaReplyDTO getReply(int qnano) {
		return (BuildQnaReplyDTO) sqlMapClientTemplate.queryForObject("AdminBuildQna.getReply", qnano);
	}


	@Override
	public BuildQnaReplyDTO getDataReply(int replyno) {
		return (BuildQnaReplyDTO) sqlMapClientTemplate.queryForObject("AdminBuildQna.getDataReply", replyno);
	}


	@Override
	public void updateReply(BuildQnaReplyDTO buildQnaReplyDTO) {
		sqlMapClientTemplate.update("AdminBuildQna.updateReply", buildQnaReplyDTO);
	}


	@Override
	public void deleteData(int qnano) {
		sqlMapClientTemplate.delete("AdminBuildQna.deleteReply",qnano);
		sqlMapClientTemplate.delete("AdminBuildQna.deleteBuildqna", qnano);
		
	}


	/*@Override
	public BuildQnADTO getData(int qnano) {
		return sqlMapClientTemplate.queryForObject("AdminBuildQna.getData",qnano);
	}*/
	
}
